<template>
  <view class="y-input">
    <view class="bet input">
      <span class="z-text">{{ text }}</span>
      <input
        type="text"
        :placeholder="`请输入${text}`"
        style="text-align: right; font-size: 24rpx"
        v-model="inputVals"
        :disabled="disabled"
        @input="change"
		 @blur="bulrfn"
      />
    </view>
	
  </view>
</template>

<script>
export default {
  name: "y-tag",
  props: {
    text: {
      type: String,
      default: "",
    },
    type: {
      type: String,
      default: "",
    },
    inputVal: {
      type: String,
      default: "",
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  computed: {
    inputVals: {
      get() {
        return this.inputVal;
      },
      set() {},
    },
  },
  methods: {
    delVal() {
      this.inputVals = "";
    },
    change(e) {
		console.log(e);
      this.$emit("change", { val: e.target.value, type: this.type });
    },
	bulrfn(e){
		this.$emit("bulrfn", e.target.value);
	}
  },
};
</script>
<style lang="scss" scoped>
.input {
  padding: 40rpx 0;
}
</style>